﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<VERKProjectHopur16.Models.Eventss>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	AllEvent
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 
    <h2>Events</h2>

     <div>
        <input type="button" onclick="document.location.href = '<%: Url.Action("CreateEvent") %>'" value="Add Event" />
    </div>

    <div class="admincontentlist">
        <table>
            <thead>
                <tr>
                    <th><%= Html.ActionLink("Name", "OrderEvent", new { id = 1 })%></th>
                    <th><%= Html.ActionLink("Start date", "OrderEvent", new { id = 2 })%></th>
                    <th><%= Html.ActionLink("End date", "OrderEvent", new { id = 3 })%></th>
                    <th><%= Html.ActionLink("Department", "OrderEvent", new { id = 4 })%></th>
                    <th><%= Html.ActionLink("Author", "OrderEvent", new { id = 5 })%></th>
                    <th></th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <% foreach (var item in Model) 
                { %>
                <tr>
                    <td><%: item.Name %></td>
                    <td><%: item.StartDate.ToString("dd MMMM yyyy HH:mm")%></td>  
                    <td><%: item.EndDate.ToString("dd MMMM yyyy HH:mm")%></td> 
                    <td><%: item.Department.Name %></td> 
                    <td><%: item.Author.Name %></td>           
                    <td><input type="button" onclick="document.location.href = '<%: Url.Action("EditEvent", new { id = item.EventID }) %>'" value="Edit" /></td>                 
                    <td><input type="button" onclick="document.location.href = '<%: Url.Action("RemoveEvent", new { id = item.EventID }) %>'" value="Delete" /></td>
                </tr>
                <% } %>
            </tbody>
        </table>
    </div>
</asp:Content>
